#include <stdio.h>
#include <string.h>
typedef struct{
    char name[25],id[25];
    int score[5],tol;
    double avg;
}student;
int main(){
    student stu[101];
    int n;
    scanf("%d",&n);
    getchar();
    for(int k=0;k<n;k++){
        gets(stu[k].name);
        gets(stu[k].id);
        stu[k].tol = 0;
        for(int i=0;i<5;i++){
            scanf("%d",&stu[k].score[i]);
            stu[k].tol+=stu[k].score[i];
        }
        getchar();
        stu[k].avg=stu[k].tol;
        stu[k].avg/=5.0;
        /*for(int i=0;i<5;i++){
            for(int j=i+1;j<5;j++){
                if(stu[k].score[i]<stu[k].score[j]){
                    int t=stu[k].score[i];
                    stu[k].score[i] = stu[k].score[j];
                    stu[k].score[j] = t;
                    }
            }
        }*/
        student *p = &stu[k];
        printf("Name:%s\n",p->name);
        printf("ID:%s\n",p->id);
        printf("Score:");
        for(int i=0;i<4;i++){
            printf("%d ",p->score[i]);
        }
        printf("%d\n",p->score[4]);
        printf("average:%.2lf total:%d\n",p->avg,p->tol);
        printf("\n");
    }
    
    //free(p);
    return 0;
}